<template>
  <div >
    
    <!-- 图片 -->
    <div v-if="props.fileType == 'image'">
      <uploader-image v-model="props.modelValue" @success="onSuccess" :limit="props.limit"></uploader-image>
    </div>


    <!-- 上传证书 -->
    <div v-if="props.fileType == 'cert'">
      <uploader-cert v-model="props.modelValue" @success="onSuccess"></uploader-cert>
    </div>

   
  </div>
</template>
<script setup>
import { reactive, ref, watch,nextTick} from "vue";
import uploaderImage from "./uploader-image.vue";
import uploaderCert from "./uploader-cert.vue";
import appStore from '@/lnk/admin/store/app'

const emit = defineEmits(["update:modelValue"]);
const props = defineProps({
  modelValue:{
    type:[ Array, String,Object],
    default(){
      return '';
    }
    
  },
  // 文件类型:image,file
  fileType: {
    type:String,
    default(){
      return 'image'
    }
  },

  // 限制数量
  limit: {
    type: [Number, String],
    default() {
      return 1;
    },
  },
});


function onSuccess(value) {
    emit('update:modelValue', value);
 }
</script>
<style lang="scss" scoped>

</style>
  
  